import {
	axiosGet,
	axiosPost
} from '@/commonApi/index.js'
// 取得首页数据
function getIndexInfo() {
	const url = "/goods/getIndexInfo"
	return new Promise(function(resolve) {
		resolve(axiosGet(url))
	})
}
//**获取商品详情信息的接口
function getDetailGoodsInfo(params) {
	const url = "/goods/getDetailGoodsInfo"
	return new Promise(function(resolve) {
		resolve(axiosPost(url,params))
	})
}

//**读取大类数据的接口 */
function getCategoryList() {
	const url = "/goods/getCategoryList"
	return new Promise(function(resolve) {
		resolve(axiosGet(url))
	})
}

/**读取小类的数据 */
function getCategorySubList(params) {
	const url = "/goods/getCategorySubList"
	return new Promise(function(resolve) {
		resolve(axiosPost(url,params))
	})
}

/**根据类别获取商品列表 */
function getGoodsListByCategorySubID(params) {
	const url = "/goods/getGoodsListByCategorySubID"
	return new Promise(function(resolve) {
		resolve(axiosPost(url,params))
	})
}
export {
	getIndexInfo,
	getDetailGoodsInfo,
	getCategoryList,
	getCategorySubList,
	getGoodsListByCategorySubID
}
